//
//  NSString+Ectentsion.m
//  01-黑马微博
//
//  Created by lanou3g on 15/9/7.
//  Copyright (c) 2015年 heima. All rights reserved.
//

#import "NSString+Ectentsion.h"

@implementation NSString (Extentsion)
//返回字符串所占用的尺寸.
-(CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize
{
    NSDictionary *attrs = @{NSFontAttributeName : font};
    return [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}

@end
